#This should be the first line of the CMakeLists.txt
cmake_minimum_required(VERSION 3.2)

# Poor practice, but very common
project(live555 VERSION 4.7.2)

#
#add_subdirectory(liveMedia)
#add_subdirectory(groupsock)
#add_subdirectory(BasicUsageEnvironment)
#add_subdirectory(UsageEnvironment)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(tools /opt/hisi-linux/x86-arm/aarch64-himix100-linux/)
set(CMAKE_C_COMPILER ${tools}/bin/aarch64-himix100-linux-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/aarch64-himix100-linux-g++)




set(LIBS ${LIBS} 
        mpi
        securec
        upvqe
        dnvqe
        VoiceEngine
        hdmi
        dsp
        sns_imx290
	sns_imx277_slvs
	sns_imx477
        sns_imx334
        sns_imx334_slave
        isp
        _hiae
        _hiawb
        _hildci
        _hidrc
        _hidehaze
        ive
        md
        nnie
)

file(GLOB USER_LIBS_FILE ./*.cpp)
file(GLOB USER_C_FILES ./*.c)
file(GLOB head_file1 ./*.h)
file(GLOB head_file2 ./include/*.h)
  

link_directories("./lib")
#include_directories("./" "./include")
add_definitions("-std=c++11 -O -DSOCKLEN_T=socklen_t -g -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -DBSD=1
				-DSENSOR0_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR1_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR2_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR3_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR4_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR5_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR6_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT
				-DSENSOR7_TYPE=SONY_IMX334_MIPI_8M_30FPS_12BIT 
				")
#add_compile_options(-std=c++11 -O -DSOCKLEN_T=socklen_t -g -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -DBSD=1)


	 
	 
add_executable(venc
		#${head_file1}
		#${head_file2}
		${USER_C_FILES}
        ${USER_LIBS_FILE}) 
		
target_include_directories(venc 
       PUBLIC .
       PUBLIC include
	 )

target_link_libraries(venc dl m pthread 
		${LIBS}
      )
